ostree-switch-root: Correctly prepend sysroot before mounts to move from dracut
authorColin Walters <walters@verbum.org>
Thu, 9 Feb 2012 01:22:27 +0000 (20:22 -0500)
committerColin Walters <walters@verbum.org>
Thu, 9 Feb 2012 01:22:27 +0000 (20:22 -0500)
src/switchroot/ostree-switch-root.c

index f02edd8f48a3968e572a4e9debf2b9046e1d800a..151b50f8c7838860b0ca0d42fccd2aca076be94a 100644 (file)
@@ -193,7 +193,7 @@ main(int argc, char *argv[])
     {
       const char *path = initramfs_move_mounts[i];
       snprintf (srcpath, sizeof(srcpath), path);
-      snprintf (destpath, sizeof(destpath), "/ostree/%s%s", ostree_target, path);
+      snprintf (destpath, sizeof(destpath), "%s/ostree/%s%s", root_mountpoint, ostree_target, path);
       if (mount (srcpath, destpath, NULL, MS_MOVE, NULL) < 0)
        {
          perrorv ("failed to move mount of %s to %s", srcpath, destpath);